function get_opening_centers() {
	$.post("centers.php",
		{type: "chart"}, 
		function(data){
			if(data != null && data != "") {
				draw_chart_centers(data["fourchette"]);
			}
		}, "json");
}

function get_center_list() {
	$.post("centers.php",
		{type: "list"}, 
		function(data){
			if(data != null && data != "") {
				for (var i=0; i< data["conference"].length;i++) {
					centers.push(data["conference"][i]);
					$("#filter_centers").append("<option value=\"" + i + "\">" + 
							data["conference"][i]["libelle"] + "</option>");
				}
			}
		}, "json");
}

function showCenter(id_center) {
	if (parseInt(id_center) > -1) {
		getCenterInfo(id_center);
		addMarker(id_center);
	}
}



function getCenterInfo(id_center) {
	$(".center_info").show();
	$(".center_info").html("<b>" + centers[id_center]["libelle"] + "</b>");
	$(".center_info").append("<br/>Ouverture: " + centers[id_center]["dateOuverture"]);
	$(".center_info").append("<br/>Adresse: " + centers[id_center]["adresse"]);
	$(".center_info").append("<br/>" + centers[id_center]["codePostal"] + " " + centers[id_center]["ville"]);
}